package com.example.design_pattern.simple_factory;

import com.example.design_pattern.domain.Fruit;
import com.example.design_pattern.exception.ErrorFruitNameException;

public class Client {

    public static void main(String[] args){
        Client client = new Client();
        client.createFruit();
   }

    private void createFruit() {
        try {
            Fruit fruit = FruitFactory.createFruit("banana");
            fruit.name();
        } catch (ErrorFruitNameException e) {
            e.printStackTrace();
        }

    }


}
